MAX_PATH = 260;

gdDevice_sType_by_iType = {
  0: "UNKNOWN",
  1: "NO_ROOT_DIR",
  2: "REMOVABLE",
  3: "FIXED",
  4: "REMOTE",
  5: "CDROM",
  6: "RAMDISK",
}

def getDriveType(sDrivePath):
  sDeviceName = str(sDrivePath[:2]); # remove any trailing "\" and convert to ascii
  import ctypes;
  iDeviceType = ctypes.windll.kernel32.GetDriveTypeA(sDrivePath);
  sDeviceType = gdDevice_sType_by_iType[iDeviceType];
  return sDeviceType;

if __name__ == "__main__":
  import sys;
  print repr(sys.argv);
  print getDriveType(sys.argv[1]);